package com.cskaoyan.controller.admin;

import com.cskaoyan.bean.vo.BaseRespVo;
import com.cskaoyan.bean.param.DashboardVo;
import com.cskaoyan.service.admin.DashboardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Yan Dexuan
 * @since 2022/06/25 20:39
 */
@RestController
@RequestMapping("admin")
public class DashboardController {

    @Autowired
    DashboardService dashboardService;

    /**
     * 显示首页信息，包括用户数量，商品数量，货品数量和订单数量。
     * @return com.cskaoyan.bean.vo.BaseRespVo
     * @author Yan Dexuan
     * @since 2022/06/25 21:10
     */

    @RequestMapping("dashboard")
    public BaseRespVo dashboard(){

        DashboardVo dashboard = dashboardService.dashboard();

        return BaseRespVo.ok(dashboard);
    }

}
